package com.wlz.learnjuc.sync;

/**
 *  synchronized 锁 的是 类
 * @author wlz
 * @date 2022-04-16  7:56 下午
 */
public class SynchronizedLockOnClass {

    static int stock;

    public static synchronized void decrStock(){
        System.out.println(--stock);
    }

    public static synchronized void cgg(){
        System.out.println();
    }

    public static void main(String[] args) {
        //SynchronizedLockOnClass.class对象
        SynchronizedLockOnClass.decrStock();
    }
}
